package poset;
import java.util.TreeMap;


import spaces.ChargeableNode;


public class User extends ChargeableNode{
	
	TreeMap<String,Poset> posets;
	
	public User(String name){
		this(name, new TreeMap<String,Poset>());
	}

	public User(String name, TreeMap<String, Poset> posets) {
		super(name);
		this.posets = posets;
	}

	public Poset getPoset(String relation) {
		return posets.get(relation);
	}

	public void addPoset(String relation, Poset poset) {
		posets.put(relation, poset);
	}
	
	public String toString(){
		StringBuffer str = new StringBuffer();
		str.append(getName()).append(":\n");
		for(String rel : posets.keySet()){
			str.append("  ").append(rel).append(":\n").append(posets.get(rel));
		}
		return str.toString();
	}
	
}
